import requests

# 定义请求URL
url = 'http://localhost:5000/update-model'

# 选择要上传的新模型文件
model_file_path = 'weights/yolov11_10.pt'

# 打开文件并发送POST请求
with open(model_file_path, 'rb') as file:
    files = {'file': file}
    response = requests.post(url, files=files)

# 检查响应状态码
if response.status_code == 200:
    print('Model update process started successfully')
    print(response.json())
else:
    print(f'Model update failed, status code: {response.status_code}')
    print(response.text)